package Test2;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;

public class Test2 {
	PrintWriter pw = null;

	public static void main(String[] args) throws IOException {
               Test2 t = new Test2();
               t.prt("内容3");
	}

	Test2() throws IOException {
		String rulerpath = "C:\\log.txt";
		File filename = new File(rulerpath);
		if (!filename.exists())
			filename.createNewFile();
		pw = new PrintWriter(new FileOutputStream(filename));
	}

	public void prt(String s) {
		pw.println(s);
		pw.flush();
	}
	
	public void closePW(){
		pw.flush();
		pw.close();
	}
}
